#include <iostream>

class CameraParam{
public:
    static CameraParam* get_instance();
    bool set_exposure(int _exposure);
    int get_exposure();

private:
    CameraParam(){}
    int exposure_;
    static CameraParam* instance_;
};

CameraParam* CameraParam::instance_ = nullptr;
CameraParam* CameraParam::get_instance(){
    if(instance_ == nullptr){
        instance_ = new CameraParam();
    }
    return instance_;
}

bool CameraParam::set_exposure(int _exposure){
    if(_exposure < 0 || _exposure > 1000)
        return false;
    exposure_ = _exposure;
}

int CameraParam::get_exposure(){
    return exposure_;
}

int main(){
    CameraParam* param = CameraParam::get_instance();
    param->set_exposure(100);
    int exposure = param->get_exposure();
    std::cout << "exposure is " << exposure << std::endl;
    return 0;
}
